{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 使用sympy学习高数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 上课内容"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sympy as sp\n",
    "from sympy import symbols,cos,sin,pi,Eq,solve,lambdify,Function\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\cos{\\left(x \\right)} + 1$"
      ],
      "text/plain": [
       "cos(x) + 1"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x,y,z,t=sp.symbols('x,y,z,t')\n",
    "expr=cos(x)+sin(pi/2)\n",
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{1}{1 + \\frac{1}{1 + \\frac{1}{1 + \\frac{1}{1 + \\frac{1}{x + 1}}}}}$"
      ],
      "text/plain": [
       "1/(1 + 1/(1 + 1/(1 + 1/(1 + 1/(x + 1)))))"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr=1/(1/x)\n",
    "for i in range(5):expr=expr.subs(x,1/(1+x))\n",
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 3.605551275464$"
      ],
      "text/plain": [
       "3.605551275464"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr=sp.sqrt(13)\n",
    "expr.evalf(13)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.        ,  1.38177329,  0.49315059, -0.84887249, -1.41044612,\n",
       "       -0.67526209,  0.68075479,  1.41088885,  0.84385821, -0.49901178])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "arr=numpy.arange(10)\n",
    "expr=sin(x)+cos(x)\n",
    "f=lambdify(x,expr,'numpy')\n",
    "type(f)\n",
    "f(arr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5TklEQVR4nO3deXxU9b3/8fdkmUlCkkkCCSGsASogm4iQhlbBSgX0onQR9XoF1Npq0SuFa4XbKsU+FFqpeq/1R22vRu/Vlmor0FoREUVcANlSlU1BFlmyQCQLkMky398fk5kQsgKZnDkzr+fjkcdNZs7ymeF4+r7f7TiMMUYAAACwvSirCwAAAED7INgBAACECYIdAABAmCDYAQAAhAmCHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhAmCHQBbWbRokRwOh2bNmmV1KQAQcgh2AGxj06ZNeuaZZzRs2DCrSwGAkESwA2ALFRUVuuWWW/SHP/xBqampVpcDACGJYAfAFmbOnKlrr71W48ePb3Vbj8ejsrKywE9paamKi4tljOmASgHAOgQ7ACFv6dKl2rp1qxYuXNim7RcuXCi32y23262Uzuka+os3lZGRoSPFJQ22W77tsPrM/Yf+7X82BqNsAOhwBDsAIe3LL7/Ufffdp5deeklxcXFt2mfevHkqLS1VaWmpCgoKAq87HI4G2zljfLfAqhpv+xUMABaKsboAAGjJli1bVFRUpEsvvTTwWm1trdatW6ff/va38ng8io6ObrCPy+WSy+WSJDmra5s9tjPaF+w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kaGpkyZot27d7e4z/PPP9/omoiLi+ugijvGL37xi0afceDAgS3uE87XidT0PdXhcGjmzJlNbh+O18m6des0efJkZWVlyeFwaPny5Q3eN8booYceUrdu3RQfH6/x48fr888/b/W453pPajfGAg899JB5/PHHzezZs43b7W70fk1NjRkyZIgZP3682bZtm3n99ddNly5dzLx581o87sSJE83w4cPNhg0bzHvvvWf69+9vbr755iB9iuDyeDzm6NGjDX5+8IMfmOzsbOP1epvdb+zYsebOO+9ssF9paWkHVh5cvXv3Ng8//HCDz1dRUdHiPnfddZfp2bOnWbNmjdm8ebP5+te/bsaMGdNBFQfXypUrzYwZM8yqVavM3r17zYoVK0xGRoaZM2dOi/u193Vy5jX5+sdHTO8HXjO9H3jNvLr1y/M+5rlYunSpcTqd5rnnnjPbt283d955p0lJSTGFhYWmorLa9Jz1spFkCopLjDHGfPDBByY6Otr8+te/Njt27DA///nPTWxsrPnkk086pN5gmzBhgsnLyzOffvqpyc/PN9dcc43p1atXi/+t5OXlmeTk5AbXREFBQQdWHXzz5883gwcPbvAZi4uLm90+3K8TY4wpKipq8H2sXr3aSDLvvPNOk9uH43Xy+uuvm5/97Gfm1VdfNZLMsmXLGry/aNEi43a7zfLly80///lPc91115ns7Gxz+vTpZo/Z0j0p2CwJdn55eXlNBrvXX3/dREVFNbhYlixZYpKTk43H42nyWDt27DCSzKZNmwKvrVy50jgcDnP48OF2r72jVVVVmfT0dPPwww+3uN3YsWPNfffd1zFFWaB3797miSeeaPP2J06cMLGxseaVV14JvLZz504jyaxfvz4IFVrv17/+tcnOzm5xm2BfJ4+9scv0fuA1M+jBlWb/sZaDd3sYPXq0mTlzZuDv2tpak5WVZRYuXNhksJs6daq59tprGxwjJyfH/OhHPwp6rVYoKioyksy7777b7DbN3Y/Dyfz5883w4cPbvH2kXSfGGHPfffeZfv36NduAEO7XydnBzuv1mszMTPPYY48FXjtx4oRxuVzmT3/6U7PHaemeFGwhOcZu/fr1Gjp0aIPFRydMmKCysjJt37692X1SUlJ02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4s549BgAhCOHMYYnZgPoUMXFxTp+/HiL2/Tt21dTp07V3//+dzn8j5WQVFtbq+joaN1yyy164YUXmtzX4/HI4/EE/jbGqKqqSl26dGlwLAAINwQ7ACHr4MGDKisrC/x95MgRTZgwQX/5y1+Uk5OjHj16WFgdAIQeumIBhKxevXo1+DsxMVGS1K9fP0IdADSByRMAAABhgq5YAACAMEGLHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhAmCHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhIn/D4fpy3XcKQs5AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<sympy.plotting.backends.matplotlibbackend.matplotlib.MatplotlibBackend at 0x19a48120f80>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import Lambda,Function,exp,plot\n",
    "f=Function('f')\n",
    "f=symbols('f',cls=Function)\n",
    "\n",
    "f=Lambda(x,sin(x)/(exp(x**2)-1))\n",
    "plot(f(x),ylim=(-4,4))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\infty$"
      ],
      "text/plain": [
       "oo"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import limit,oo\n",
    "\n",
    "f=Lambda(x,(exp(x)-1/x))\n",
    "\n",
    "limit(f(x),x,oo)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left( -1, \\  1\\right)$"
      ],
      "text/plain": [
       "(-1, 1)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f1=Lambda(x,x)\n",
    "\n",
    "limit(f1(x),x,(-1,1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 作业\n",
    "## 1.极限与连续\n",
    "## 2.微分\n",
    "## 3.积分\n",
    "## 4.级数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.极限与连续"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例1: 对x，作图观察，$f(x)= \\sin \\frac{x}{e^{x^2}-1}  $ 的函数走向"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAHWCAYAAAD6oMSKAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAA5TklEQVR4nO3deXxU9b3/8fdkmUlCkkkCCSGsASogm4iQhlbBSgX0onQR9XoF1Npq0SuFa4XbKsU+FFqpeq/1R22vRu/Vlmor0FoREUVcANlSlU1BFlmyQCQLkMky398fk5kQsgKZnDkzr+fjkcdNZs7ymeF4+r7f7TiMMUYAAACwvSirCwAAAED7INgBAACECYIdAABAmCDYAQAAhAmCHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhAmCHQBbWbRokRwOh2bNmmV1KQAQcgh2AGxj06ZNeuaZZzRs2DCrSwGAkESwA2ALFRUVuuWWW/SHP/xBqampVpcDACGJYAfAFmbOnKlrr71W48ePb3Vbj8ejsrKywE9paamKi4tljOmASgHAOgQ7ACFv6dKl2rp1qxYuXNim7RcuXCi32y23262Uzuka+os3lZGRoSPFJQ22W77tsPrM/Yf+7X82BqNsAOhwBDsAIe3LL7/Ufffdp5deeklxcXFt2mfevHkqLS1VaWmpCgoKAq87HI4G2zljfLfAqhpv+xUMABa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/20+vTpo7i4OOXk5Oijjz5qcftXXnlFAwcOVFxcnIYOHarXX3+9gyoNvoULF2rUqFFKSkpSRkaGpkyZot27d7e4z/PPP9/omoiLi+ugijvGL37xi0afceDAgS3uE87XidT0PdXhcGjmzJlNbh+O18m6des0efJkZWVlyeFwaPny5Q3eN8booYceUrdu3RQfH6/x48fr888/b/W453pPajfGAg899JB5/PHHzezZs43b7W70fk1NjRkyZIgZP3682bZtm3n99ddNly5dzLx581o87sSJE83w4cPNhg0bzHvvvWf69+9vbr755iB9iuDyeDzm6NGjDX5+8IMfmOzsbOP1epvdb+zYsebOO+9ssF9paWkHVh5cvXv3Ng8//HCDz1dRUdHiPnfddZfp2bOnWbNmjdm8ebP5+te/bsaMGdNBFQfXypUrzYwZM8yqVavM3r17zYoVK0xGRoaZM2dOi/u193Vy5jX5+sdHTO8HXjO9H3jNvLr1y/M+5rlYunSpcTqd5rnnnjPbt283d955p0lJSTGFhYWmorLa9Jz1spFkCopLjDHGfPDBByY6Otr8+te/Njt27DA///nPTWxsrPnkk086pN5gmzBhgsnLyzOffvqpyc/PN9dcc43p1atXi/+t5OXlmeTk5AbXREFBQQdWHXzz5883gwcPbvAZi4uLm90+3K8TY4wpKipq8H2sXr3aSDLvvPNOk9uH43Xy+uuvm5/97Gfm1VdfNZLMsmXLGry/aNEi43a7zfLly80///lPc91115ns7Gxz+vTpZo/Z0j0p2CwJdn55eXlNBrvXX3/dREVFNbhYlixZYpKTk43H42nyWDt27DCSzKZNmwKvrVy50jgcDnP48OF2r72jVVVVmfT0dPPwww+3uN3YsWPNfffd1zFFWaB3797miSeeaPP2J06cMLGxseaVV14JvLZz504jyaxfvz4IFVrv17/+tcnOzm5xm2BfJ4+9scv0fuA1M+jBlWb/sZaDd3sYPXq0mTlzZuDv2tpak5WVZRYuXNhksJs6daq59tprGxwjJyfH/OhHPwp6rVYoKioyksy7777b7DbN3Y/Dyfz5883w4cPbvH2kXSfGGHPfffeZfv36NduAEO7XydnBzuv1mszMTPP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KACGBFjsAHW7u3Ln61a9+1eI2O3fu1Jtvvqny8nLNmzev1WMu/WFu4Pdf/OIXWrBgQaNt4s549BgAhCOHMYYnZgPoUMXFxTp+/HiL2/Tt21dTp07V3//+dzn8j5WQVFtbq+joaN1yyy164YUXmtzX4/HI4/EE/jbGqKqqSl26dGlwLAAINwQ7ACHr4MGDKisrC/x95MgRTZgwQX/5y1+Uk5OjHj16WFgdAIQeumIBhKxevXo1+DsxMVGS1K9fP0IdADSByRMAAABhgq5YAACAMEGLHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhAmCHQAAQJgg2AEAAIQJgh0AAECYINgBAACECYIdAABAmCDYAQAAhIn/D4fpy3XcKQs5AAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<sympy.plotting.backends.matplotlibbackend.matplotlib.MatplotlibBackend at 0x19a71adb890>"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import Lambda,Function,exp,plot\n",
    "f=Function('f')\n",
    "f=symbols('f',cls=Function)\n",
    "\n",
    "f=Lambda(x,sin(x)/(exp(x**2)-1))\n",
    "plot(f(x),ylim=(-4,4))\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例2: 求 $ \\lim \\limits_{x \\to 0} \\frac{e^x-1}{x}=1 $的极限"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle -\\infty$"
      ],
      "text/plain": [
       "-oo"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import limit\n",
    "\n",
    "f=Lambda(x,(exp(x)-1/x))\n",
    "\n",
    "limit(f(x),x,0)\n",
    "result = limit(f(x), x, 0)\n",
    "\n",
    "print(\"极限是:\",result)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例3：计算极限 $ \\lim \\limits_{x \\to 0} \\frac{e^x-cosx}{x^2} $"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "极限是: oo\n"
     ]
    }
   ],
   "source": [
    "f=Lambda(x,(exp(x) - cos(x))/x**2)\n",
    "\n",
    "limit(f(x), x, 0)\n",
    "result = limit(f(x), x, 0)\n",
    "\n",
    "print(\"极限是:\",result)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例4: 求 $ \\lim \\limits_{x \\to 1 } \\frac{x^2 - 1}{x - 1} $的极限"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "极限是: 2\n"
     ]
    }
   ],
   "source": [
    "f = Lambda(x,(x**2 - 1) / (x - 1))\n",
    "\n",
    "limit(f(x), x, 1)\n",
    "result = limit(f(x), x, 1)\n",
    "\n",
    "print(\"极限是:\",result)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2. 微分"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例1：已知函数$ f(x) = \\begin{cases}\\frac{1}{2}(x^2+1)  & (x\\le 1) \\\\\\frac{1}{2}(x+1) & (x\\gt 1)\\end{cases} $ ,判断f(x)在x=1处是否可导。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1, 1)"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import Piecewise,Rational\n",
    "\n",
    "f=Piecewise((Rational(1/2)*(x**2+1),x<=1), (Rational(1/2)*(x+1),x>1))\n",
    "\n",
    "limit((f.subs(x,1+t)-f.subs(x, 1))/t,t, 0, '-'),limit((f.subs(x,1+t)-f.subs(x, 1))/t,t, 0, '+')\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例2：设$ \\begin{cases}x  = \\sin t \\\\y  =t - \\cos t\\end{cases}$,求$\\frac{\\partial^2 y}{dx^2}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - \\frac{1}{\\left(\\sin{\\left(x \\right)} + 1\\right)^{2}}$"
      ],
      "text/plain": [
       "-1/(sin(x) + 1)**2"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f=Lambda(x, sin(x))\n",
    "\n",
    "g=Lambda(x, x-cos(x))\n",
    "\n",
    "(((f(x).diff(x)/g(x).diff(x)).diff(x))/g(x).diff(x)).simplify()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例3: 求函数 $ f(x) = x^3 - 2x^2 + x $ 的导数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 3 x^{2} - 4 x + 1$"
      ],
      "text/plain": [
       "3*x**2 - 4*x + 1"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import diff\n",
    "\n",
    "x = symbols('x')\n",
    "f = x**3 - 2*x**2 + x\n",
    "\n",
    "diff(f, x)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例4: 求函数$ h(x)=ln(x^2+1) $的导数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{2 x}{x^{2} + 1}$"
      ],
      "text/plain": [
       "2*x/(x**2 + 1)"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import ln\n",
    "\n",
    "x = symbols('x')\n",
    "h = ln(x**2 + 1)\n",
    "\n",
    "diff(h, x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例5：求函数$ m(x)= \\sqrt{x^3+2x}\\ $的导数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{\\frac{3 x^{2}}{2} + 1}{\\sqrt{x^{3} + 2 x}}$"
      ],
      "text/plain": [
       "(3*x**2/2 + 1)/sqrt(x**3 + 2*x)"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = symbols('x')\n",
    "m = sqrt(x**3 + 2*x)\n",
    "\n",
    "diff(m, x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.积分"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例1: 求不定积分 $\\int \\frac{\\arctan{\\sqrt{x}}}{(1+x)\\sqrt{x}}$。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\operatorname{atan}^{2}{\\left(\\sqrt{x} \\right)}$"
      ],
      "text/plain": [
       "atan(sqrt(x))**2"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import atan,integrate\n",
    "\n",
    "f=Lambda(x, atan(sqrt(x))/((1+x)*sqrt(x)))\n",
    "\n",
    "integrate(f(x), x)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 例2: 计算积分$\\int_{0}^{+\\infty} e^{-x^2} dx$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{\\sqrt{\\pi}}{2}$"
      ],
      "text/plain": [
       "sqrt(pi)/2"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "integrate(exp(-x**2), (x, 0, oo))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
